Results 1 to 8 of 8

Thread: Counting deaths

  1. #1

    Default Counting deaths

    I'm looking for a way to count the times a player has died - I want the player to be unable to respawn after they've died three times until the next round starts. Any ideas?

  2. #2
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,566

    Default

    check mixed gametypes mod , it has all ur needs , but to deaths is some how complex . You can use the event system :3

    kill local.attacker local.damage local.inflictor local.position local.direction local.normal local.knockback local.damageflags local.meansofdeath local.location local.player:
    if(!local.player.deaths)
    local.player.deaths = 0
    local.player.deaths++
    if(local.player.deaths >= 3)
    {
    //code here (check mefy's mixed gametypes mod )
    }
    end

  3. #3
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    What gametype are you working with?

    If it is a gametype which counts them already(tdm,ffa) etc when they are up on scoretab, you can get them with the command getdeaths

    local.player_deaths = local.player getdeaths

    Other then that, what ry posted above should be good

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  4. #4

    Default

    Quote Originally Posted by Purple Elephant1au View Post
    What gametype are you working with?

    If it is a gametype which counts them already(tdm,ffa) etc when they are up on scoretab, you can get them with the command getdeaths

    local.player_deaths = local.player getdeaths

    Other then that, what ry posted above should be good

    I'm using FFA, so it would look something like this?

    while(1){
    local.player_deaths = local.player getdeaths
    if (local.player_deaths >= 3){
    //whatever script I need to not let them respawn
    }
    }

  5. #5
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,566

    Default

    nah , there is a smarter way , use the script I wrote but instead of creating ur own variables use the get deaths cmd
    no need to use loops .
    it's more stable that way

  6. #6
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,245

    Default

    I would avoid while-loops (infinite ones), use events (killed or respawn), and I'm not sure if you can prevent someone from spawning on FFA (or at all), but you could freeze that person and make it invulnerable.

  7. #7
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Or just use the spawn event
    spawn local.player:
    
    if((local.player getdeaths) >= 3)
    {
    local.player takeall // Takes weapons
    local.player nodamage /// no damage so they cant die again and mess up others scores
    }
    
    end


    Or of course you could freeze/hide/move players out of way/noclip etc
    Or just move to spectate but that would cause conflicts when new map, have to move players back/ or move them to a ft type spectate ie floating behind players.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  8. #8

    Default

    Quote Originally Posted by Purple Elephant1au View Post
    Or just use the spawn event
    spawn local.player:
    
    if((local.player getdeaths) >= 3)
    {
    local.player takeall // Takes weapons
    local.player nodamage /// no damage so they cant die again and mess up others scores
    }
    
    end


    Or of course you could freeze/hide/move players out of way/noclip etc
    Or just move to spectate but that would cause conflicts when new map, have to move players back/ or move them to a ft type spectate ie floating behind players.

    I'll try with the spawn event and see about pulling apart the FT spectate mode so that players can respawn on a new round. Thanks!
    Last edited by [cB]SplatterGuts; March 25th, 2015 at 04:27 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •